package com.service.Impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import com.dao.CartDao;
import com.domain.Cart;
import com.domain.Carts;
import com.service.CartService;
import com.util.SqlSessionUtils;

public class CartServiceImpl implements CartService{
	SqlSession sqlSession = SqlSessionUtils.getSqlSession();
	CartDao cartDao = sqlSession.getMapper(CartDao.class);

    @Override
    public void addGoods(Cart cart) {
        cartDao.addGoods(cart);
        //提交事务
        sqlSession.commit();
    }

	@Override
	public List<Cart> findByCart() {
		return cartDao.findByCart();
	}

	@Override
	public List<Carts> findIdName(int i) {
		return cartDao.findIdName(i);
	}

}
